import request from '@/utils/request'

const BASE_URL = 'interface/'
const READ_URL = BASE_URL + '/'
export function getInterfaceList(params) {
  return request({
    url: BASE_URL,
    method: 'get',
    params: params
  })
}

export function getInterface(id) {
  return request({
    url: BASE_URL + id + '/',
    method: 'get'
  })
}

export function createInterface(data) {
  return request({
    url: BASE_URL,
    method: 'post',
    data: data
  })
}

export function updateInterface(id, data) {
  return request({
    url: BASE_URL + id + '/',
    method: 'patch',
    data: data
  })
}

export function deleteInterface(id) {
  return request({
    url: BASE_URL + id + '/',
    method: 'delete'
  })
}

export function getInterfaceCount() {
  return request({
    url: BASE_URL + 'count/',
    method: 'get'
  })
}
